import request from '@/utils/request'

// 查询费用预存列表
export function listPrestore(query) {
  return request({
    url: '/pay/prestore/list',
    method: 'get',
    params: query
  })
}

// 查询费用预存详细
export function getPrestore(id) {
  return request({
    url: '/pay/prestore/' + id,
    method: 'get'
  })
}

// 新增费用预存[预存]
export function addPrestorePay(data) {
  return request({
    url: '/pay/prestore/addPay',
    method: 'post',
    data: data
  })
}
// 新增费用预存[退费]
export function addPrestoreRefund(data) {
  return request({
    url: '/pay/prestore/addRefund',
    method: 'post',
    data: data
  })
}
// 费用预存确定
export function confirmPay(id) {
  return request({
    url: '/pay/prestore/confirmPay/'+id,
    method: 'post'
  })
}

// 费用退还确定
export function confirmRefund(id) {
  return request({
    url: '/pay/prestore/confirmRefund/'+id,
    method: 'post'
  })
}

//根据业主ID查询当前业主的所有预存款
export function getPayPrestoreAccountByUserOwnerId(id) {
  return request({
    url: '/pay/prestore/getPayPrestoreAccountByUserOwnerId/' + id,
    method: 'get'
  })
}

//退还预存款
export  function refundPrestoreAccount(data){
  return request({
    url: '/pay/prestore/refundPrestoreAccount',
    method: 'post',
    data:data
  })
}
